package com.drawing.dao;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import com.drawing.common.SupplierLazy;
import com.drawing.common.util.JdbcTemplateUtils;
import com.drawing.pojo.IPenetration;

/**
 * @author zhaozhenhang <zhaozhenhang@kuaishou.com>
 * Created on 2023-10-15
 */
@Component
public class IpDAO {

    private static final SupplierLazy<JdbcTemplate> JDBC_TEMPLATE = SupplierLazy.lazy(JdbcTemplateUtils::init);

    private JdbcTemplate writeJdbcTemplate() {
        return JDBC_TEMPLATE.get();
    }

    public IPenetration query() {
        String sql = "select * from image_info where id = 1 ";
        return writeJdbcTemplate().queryForObject(sql, IPenetration.class);
    }
}
